package com.lfs.softwork.controller;

import com.lfs.softwork.service.FileService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/start")
@AllArgsConstructor
public class StartController {
    FileService fileService;

    @GetMapping("/hello")
    public String hello() {
        return "success";
    }

    @PostMapping("/readCode")
    public void readCode(@RequestParam("file") MultipartFile file,@RequestParam(value = "dir",required = false) String dir) {
        fileService.textFile(file,dir);
    }
}
